<template>
  <div class="cloudIndex">
    <div class="wrap come" style="margin-top: 44px">
      <div class="cloud" style="transform: scale(0.4) translate(20%);"></div>
    </div>
    <div class="wrap back" style="margin-top: 20px">
      <div class="cloud" style="transform: scale(0.5)"></div>
    </div>
    <div class="wrap come">
      <div class="cloud" style="transform: scale(0.6)"></div>
    </div>
  </div>
</template>
<script>
export default {
  name: "Cloud"
};
</script>
<style lang="less" scoped>
.cloudIndex {
  width: 100%;
  overflow: hidden;
  position: relative;
  z-index: 9;
  margin-top: 0.5rem;

  .wrap {
    display: flex;
    align-items: center;
    height: 50px;

    .cloud {
      width: 120px;
      height: 40px;
      background: #f2f9fe;
      background: linear-gradient(top, #f2f9fe 5%, #d6f0fd 100%);
      border-radius: 40px;
      -webkit-border-radius: 100px;
      -moz-border-radius: 100px;
      position: relative;
      z-index: 1;
      opacity: 0.8;
    }
    .cloud:after,
    .cloud:before {
      content: "";
      position: absolute;
      background: #f2f9fe;
      z-index: 0;
    }
    .cloud:after {
      width: 40px;
      height: 40px;
      right: 60px;
      bottom: 20px;
      border-radius: 20px;
      -webkit-border-radius: 20px;
      -moz-border-radius: 20px;
    }
    .cloud:before {
      width: 60px;
      height: 60px;
      right: 20px;
      bottom: 10px;
      border-radius: 30px;
      -webkit-border-radius: 30px;
      -moz-border-radius: 30px;
    }
  }
  .come {
    animation: cloud 40s linear infinite;
  }
  .back {
    animation: cloudBack 40s linear infinite;
  }
  @keyframes cloud {
    from {
      transform: translateX(-30%);
    }
    to {
      transform: translateX(100%);
    }
  }
  @keyframes cloudBack {
    from {
      transform: translateX(100%);
    }
    to {
      transform: translateX(-30%);
    }
  }
}
</style>
